import wx
from wx.wizard import *

class Page(PyWizardPage):

   """ An extended panel obj with a few methods to keep track of its siblings.
      This should be modified and added to the wizard.  Season to taste."""
   def __init__(self, parent, title):
      PyWizardPage.__init__(self, parent)
      self.next = self.prev = None
      self.sizer = wx.BoxSizer(wx.VERTICAL)
      title = wx.StaticText(self, wx.ID_ANY, title)
      title.SetFont(wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD))
      self.sizer.AddWindow(title, 0, wx.ALIGN_LEFT|wx.ALL, 5)
      self.sizer.AddWindow(wx.StaticLine(self, -1), 0, wx.EXPAND|wx.ALL, 5)
      self.SetSizer(self.sizer)

   def Clear(self):
      """ removes all widgets """
      for child in self.GetChildren():
         self.RemoveChild(child)

   def AddWidget(self, stuff):
     'Add additional widgets to the bottom of the page'
     self.sizer.Add(stuff, 0, wx.EXPAND|wx.ALL, 5)

   def AddText(self, text):
      """ Add a text object to the page. """
      self.AddWidget(wx.StaticText(self, wx.ID_ANY, text))

   def SetNext(self, next):
     'Set the next page'
     self.next = next

   def SetPrev(self, prev):
     'Set the previous page'
     self.prev = prev

   def GetNext(self):
      'Return the next page'
      return self.next

   def GetPrev(self):
      'Return the previous page'
      return self.prev

